<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css"/>
    <!--地址添加样式-->
    <link rel="stylesheet" href="../../../ht-css/replaceAddress/addAddress.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>代客下单</title>
</head>
<body data-id="29">
<nav class="breadcrumb">订单管理 <span class="c-gray en">&gt;</span> 代客下单<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<article class="page-container">
    <div class="bg-1 bk-gray ml-20 pt-20 pb-20 mr-20">
        <form class="clearfix">
            <div class="clearfix">
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">客户名称：</div>
                    <span class="size-M f-l select_s">
                        <input type="text" autocomplete="off" class="input-text radius" name="class1" oninput="getCustomer()" id="customerName">
                        <ul class="relation radius guanlian" id="customerUl" style="z-index: 999">

                        </ul>
                    </span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">手机号：</div>
                    <span class="size-M f-l select_ph">
                        <input type="text" class="input-text radius" id="mobilePhone" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'')" maxlength="11">
                    </span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">下单账号：</div>
                    <span class="size-M f-l select_s">
                        <input type="text" autocomplete="off" class="input-text radius" name="class1" oninput="getOrderAccount(this.value)" id="code">
                        <input  name='customerId' type='hidden' id='customerId'>
                        <ul class="relation radius guanlian" id="codeUl"  style="z-index: 999" name="orderAccountUrl">
                        </ul>
                    </span>
                </div>
                <input type="button" onclick="searchInfo()" class="btn btn-secondary radius powerButton 90" value="确&nbsp;&nbsp;定">
            </div>
            <div class="clearfix">
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">客户名称：</div><span class="size-M f-l select_s"><span class="lh-16" id="cusNameInfo"></span></span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">公司地址：</div><span class="size-M f-l select_ph"><span class="lh-16" id="address"></span></span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">下单账号：</div>
                    <span class="select-box size-M radius f-l select_s" id="orderCode">
                        <select class="select" onchange="getCustomerInfo(this)">
                            <option value="">无数据</option>
                        </select>
                        <div id="isNeedAuditList"></div>

                    </span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable_t" id="isCheck"></div>
                    <span class="replaceorder_lable_t" id="limitBox">可用额度：¥<span id="limit">0.00</span></span>
                </div>
                <div class="low pos-r">
                    <span class="replaceorder_lable_t" id="accountType"></span>
                </div>
            </div>
            <div class="clearfix" id="app">
                <div class="clearfix area">
                    <label class="replaceorder_lable w4">收货区域：</label>
                    <div class="commonArea f-l mr-20">
                        <div class="area_box">
                            <div class="inp_area radius" @click="isAreaShow">
                                <div class="inp_area_box">
                                    <span id="notVueBox" class="divHide">
                                        <span id="provinceName">请选择收货区域</span>
                                        <span id="cityName"></span>
                                        <span id="countyName"></span>
                                        <span id="villageName"></span>
                                    </span>
                                    <span id="vueBox" class="divHide" style="display: none;">
                                        <span id="vueProvinceName">{{provinceName}}</span>
                                        <span id="vueCityName">{{cityName}}</span>
                                        <span id="vueCountyName">{{countyName}}</span>
                                        <span id="vueVillageName">{{villageName}}</span>
                                        <div style="display: none;">
                                            <span id="provinceId">{{provinceId}}</span>
                                            <span id="cityId">{{cityId}}</span>
                                            <span id="countyId">{{countyId}}</span>
                                            <span id="villageId">{{villageId}}</span>
                                        </div>
                                        <div style="display: none;">
                                            <span id="provinceCode">{{provinceCode}}</span>
                                            <span id="cityCode">{{cityCode}}</span>
                                            <span id="countyCode">{{countyCode}}</span>
                                            <span id="villageCode">{{villageCode}}</span>
                                        </div>
                                    </span>

                                </div>
                            </div>
                            <div v-show="areaShow" class="area_list">
                                <div class="tab clearfix">
                                    <span style="cursor:pointer;" v-show="areaTab1" :class="{curr: isCurr1}" @click="getArea('101','','','tab')">{{tabArea1}}</span>
                                    <span style="cursor:pointer;" v-show="areaTab2" :class="{curr: isCurr2}" @click="getArea('102',parentCode2,goName2,'tab')">{{tabArea2}}</span>
                                    <span style="cursor:pointer;" v-show="areaTab3" :class="{curr: isCurr3}" @click="getArea('103',parentCode3,goName3,'tab')">{{tabArea3}}</span>
                                    <span style="cursor:pointer;" v-show="areaTab4" :class="{curr: isCurr4}">{{tabArea4}}</span>
                                </div>
                                <a @click="closeArea" class="close">关闭</a>
                                <ul class="list clearfix">
                                    <li v-for="area in areas" style="cursor:pointer;" @click="getArea(area.level,area.code,area.name,'noTab',area.address_id)">
                                        {{area.name}}
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!--<div class="low pos-r pl-20">
                        <div class="replaceorder_lable_t"><a href="##">新增收货地址</a></div>
                    </div>-->
                </div>
            </div>
            <div class="clearfix">
                <div class="low pos-r">
                    <div class="replaceorder_lable w4">常用地址：</div>
                    <span class="replaceorder_lable_t" id="offenAddress"></span>
                </div>
            </div>
            <div class="clearfix from_ask_price hide">
                <div class="low ml-20" style="border:1px solid #e8e8e8;">
                    <div class="replaceorder_lable w4 pr-20 pl-10" style="line-height:30px;">来自询价单</div>
                    <span class="replaceorder_lable_t" id="inquiry_id"></span>
                    <span class="il-b pr-20" style="line-height:30px;" id="inquiryStatus">仅临采商品</span>
                </div>
            </div>
        </form>
        <form class="clearfix bg-f9">
            <div class="clearfix">
                <div class="low pos-r">
                    <div class="replaceorder_lable">助记码：</div><span class="size-M f-l select_s"><input id="helpCode" type="text" class="input-text radius" onkeyup="this.value=this.value.replace(/\s+/g,'')"></span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable">商品名称：</div><span class="size-M f-l select_s"><input id="skuName" type="text" class="input-text radius" onkeyup="this.value=this.value.replace(/\s+/g,'')"></span>
                </div>
                <div class="low pos-r">
                    <div class="replaceorder_lable">商品Code码：</div><span class="size-M f-l select_s"><input id="skuId" type="text" class="input-text radius" onkeyup="this.value=this.value.replace(/\s+/g,'')"></span>
                </div>
                <input type="button" onclick="goSearchGoods()" class="btn btn-secondary radius btn-s mr-10 powerButton 91" value="搜索">
                <input type="button" onclick="searchGoodsList()" class="btn radius btn-s" style="background: #fff" value="商品列表搜索">
            </div>
        </form>

        <div class="pd-20 table_nopage">
            <div class="pos-r table_sku_list">
                <table class="table table-sort table-bg pos-r">
                    <colgroup>
                        <col width="60"><!--序号-->
                        <col width="100"><!--商品SKU码-->
                        <col width="150"><!--商品名称-->
                        <col width="120"><!--规格型号-->
                        <col width="80" style="display: none;"><!--产地-->
                        <col width="100"><!--数量-->
                        <col width="80"><!--计量单位-->
                        <col width="80"><!--件装数量-->
                        <col width="80"><!--最小起订量-->
                        <col width="50"><!--单价类型-->
                        <col width="50"><!--单价-->
                        <col width="50"><!--小计-->
                        <col width="50"><!--实际库存-->
                        <col width="50"><!--缺货数量-->
                        <col width="50"><!--可超卖库存-->
                        <col width="50"><!--预计出货日-->
                        <col width="50"><!--库房-->
                        <col width="117"><!--操作-->
                    </colgroup>
                    <thead>
                    <tr class="text-c">
                        <th>序号</th>
                        <th>商品Code码</th>
                        <th>商品名称</th>
                        <th>规格型号</th>
                        <th style="display: none;">产地</th>
                        <th>数量</th>
                        <th>计量单位</th>
                        <th>件装数量</th>
                        <th>最小起订量</th>
                        <th>单价类型</th>
                        <th>单价</th>
                        <th>小计</th>
                        <th>实际库存</th>
                        <th>缺货数量</th>
                        <th>可超卖库存</th>
                        <th>预计出货日</th>
                        <th>库房</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                </table>
                <div class="table_list" id="tableDiv">
                    <table class="table table-sort pos-a" id="datatable">
                        <colgroup>
                            <col width="60"><!--序号-->
                            <col width="100"><!--商品SKU码-->
                            <col width="150"><!--商品名称-->
                            <col width="120"><!--规格型号-->
                            <col width="80" style="display: none;"><!--产地-->
                            <col width="100"><!--数量-->
                            <col width="80"><!--计量单位-->
                            <col width="80"><!--件装数量-->
                            <col width="80"><!--最小起订量-->
                            <col width="50"><!--单价类型-->
                            <col width="50"><!--单价-->
                            <col width="50"><!--小计-->
                            <col width="50"><!--实际库存-->
                            <col width="50"><!--缺货数量-->
                            <col width="50"><!--可超卖库存-->
                            <col width="50"><!--预计出货日-->
                            <col width="50"><!--库房-->
                            <col width="100"><!--操作-->
                        </colgroup>
                        <tbody>
                        </tbody>
                    </table>
                </div>
                <div class="settle">
                    <div class="all f-l">
                        <input type="checkbox" id="select-all-inp" onclick="selectAll(this)" class="mr-10 select-all-inp">
                        <span>全选</span>
                    </div>
                    <div onclick="deletSelect()" class="deleteAll f-l powerButton 93" style="cursor:pointer;">
                        -删除选中商品
                    </div>
                    <div class="amount">
                        <lable>商品金额总计（不包含运费）：<b>¥<span id="amountMoney">0.00</span></b></lable>
                    </div>
                    <div class="buyCount">
                        <lable>购买数量：</lable>
                        <span><span id="buyCount">0</span></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="text-c pb-25 pt-25">
        <input type="button" onclick="goDrafts()" class="btn radius btn-s mr-10 powerButton 94" value="保存草稿">
        <input name="" type="button" onclick="out_of_stock_fn()" class="btn btn-secondary radius btn-s " id="nextBtn" value="下一步">
    </div>
    <!--删除弹出层-->
    <div id="modal-demo" class="modal fade pop_win" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:420px;">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">提示</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:;">×</a>
                </div>
                <div class="modal-body modal-center">
                    <p>确认要删除该商品吗？</p>
                </div>
                <div align="center" class="button">
                    <button class="btn btn-primary radius" onclick="deleteSure()">确定</button>
                    <button class="btn radius" data-dismiss="modal" aria-hidden="true">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--删除选中弹出层-->
    <div id="modal-delete" class="modal fade pop_win" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:420px;margin:-113px 0 0 -210px;position: fixed;top:50%;left:50%">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">提示</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:;">×</a>
                </div>
                <div class="modal-body modal-center">
                    <p>确认要删除选中的商品吗？</p>
                </div>
                <div align="center" class="button">
                    <button class="btn btn-primary size-L radius" onclick="deleteSelectSure()">确定</button>
                    <button class="btn radius size-L" data-dismiss="modal" aria-hidden="true">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--切换账户-->
    <div id="change-customer" class="modal fade pop_win" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:420px;margin:-113px 0 0 -210px;position: fixed;top:50%;left:50%">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">提示</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:;">×</a>
                </div>
                <div class="modal-body modal-center">
                    <p>是否切换账号，切换后将清空商品列表？</p>
                </div>
                <div align="center" class="button">
                    <button class="btn btn-primary size-L radius" onclick="changeSure()">确定</button>
                    <button class="btn radius size-L" data-dismiss="modal" aria-hidden="true">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!----------------------------没有实际库存------------------------->
    <div id="noStocker" class="modal fade pop_win" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:420px;">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">提示</h3>
                </div>
                <div class="modal-body modal-center">
                    <p style="margin: 0 auto; padding-bottom: 15px;width:300px;text-align:left;">存在缺货商品，请进行补货后再进行下单，您确认下单吗？</p >
                </div>
                <div align="center" class="button">
                    <button class="btn radius size-L" data-dismiss="modal" aria-hidden="true" onclick="setRedFn()">查看</button>
                    <button class="btn btn-primary radius size-L" onclick="goConFirmOrder()">确定</button>

                </div>
            </div>
        </div>
    </div>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/vue.min.js?rev=@@hash"></script>
<script src="../../../lib/base64.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<!--权限控制-->
<script type="text/javascript" src="../../../ht-js/power.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/order/replaceOrder/creatNewOrder.js?rev=@@hash"></script>
<!--地址添加js-->
<script type="text/javascript" src="../../../ht-js/order/replaceOrder/replaceOrderVue.js?rev=@@hash"></script>
<script>

    //联想下单帐号
    function getOrderAccount(data) {
        $("#codeUl").html("");
        $.post(root.replaceInter.replace_adminLenovoByLoginAccount,{"subAccount":data},function (obj) {
            $.each(obj.subAccountList,function (index,account) {
                $("#codeUl").append("<li id='liaccount"+index+"' value='"+account.customer_id+"'  onclick='getValueLi("+index+")'>"+account.sub_account+"</li>")
            })
            $("#codeUl").css("display","block");
        })
    }
    //获取选中li的值,填充上面的输入框code
    function getValueLi(data){
        //清除上面的输入框
        $("#code").val("");
        $("#customerId").val("");

        //获取当前选中帐号对应的customerId
        var customerId = $("#liaccount"+data).attr("value");
        //获取当前选中帐号
        var orderAccount = $("#liaccount"+data).html();

        //填充上面的输入框
        $("#code").val(orderAccount);

        //添加影藏的input用来保存选中的customerId
        $("#customerId").val(customerId);

        $("#codeUl").css("display","none");

    }
</script>
</body>
</html>